package com.dbb.entity;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLDecoder;

/**
* Attachment.
*/
public class Attachment {
	
	private String fileName;
	private Long type;
	private String contentType;
	private String filePath;
	private String saveName;
	private String md5;
	private File upload;
	private String fileTitle;
	private Integer status = -1;
	private String shootingDate;
	private String shootingPlace;
	
	public Attachment() {
	}

	public String getUploadFileName() {
        return fileName;
    }
	
    public void setUploadFileName(String fileName) {
        this.fileName = fileTitle==null ? fileName : fileTitle;
    }

	public String getUploadFileNameExt() {
		int pos = fileName.lastIndexOf(".");
		if (pos == -1)
			return "";
		String tname = fileName.substring(pos, fileName.length());
		if (-1 == tname.indexOf("/") && -1 == tname.indexOf("\\"))
			return tname;
		else
			return "";
	}
	
    public String getUploadContentType() {
        return contentType;
    }
    public void setUploadContentType(String contentType) {
        this.contentType = contentType;
    }

    public File getUpload() {
        return upload;
    }
    public void setUpload(File upload) {
        this.upload = upload;
    }

	public String getFileName() {
		return this.fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public Long getType() {
		return this.type;
	}

	public void setType(Long type) {
		this.type = type;
	}

	public String getContentType() {
		return this.contentType;
	}

	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	public String getFilePath() {
		return this.filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
	
	public String getFileTitle() {
		return fileTitle;
	}

	public void setFileTitle(String fileTitle) {
		this.fileTitle = fileTitle;
	}

	public String getMd5() {
		return this.md5;
	}

	public void setMd5(String md5) {
		this.md5 = md5;
	}
	
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	public String getSaveName() {
		return saveName;
	}

	public void setSaveName(String saveName) {
		this.saveName = saveName;
	}
	
	public String getShootingDate() {
		return shootingDate;
	}

	public void setShootingDate(String shootingDate) {
		this.shootingDate = shootingDate;
	}

	public String getShootingPlace() {
		return shootingPlace;
	}

	public void setShootingPlace(String shootingPlace) {
		this.shootingPlace = shootingPlace;
	}


}
